/**
 * 
 */
package gameEngine;

import java.util.Hashtable;

/**
 * @author Joe R. Nassimian
 * @author Yannis Mazzer
 */
public class BoardSpecs extends Hashtable <Integer,Integer[]> {

	
	/**
	 * Eclipse generated serial number.
	 */
	private static final long serialVersionUID = 7272799304501312318L;

	public BoardSpecs(Integer[] _dim, Integer[][] _edgeSize) {
		if (_dim.length == _edgeSize.length) {
			for(int i = 0 ; i < _dim.length; i++){
				put(_dim[i],_edgeSize[i]);
			}
		}
	}
	
	public int getEdgeSize(int _dim) {
		return this.get(_dim)[1];
	}
	
	public Integer[] getNbPlayers(int _dim) {
		int max = this.get(_dim)[0];
		Integer[] nbPlayers = new Integer[max-1];
		
		for(int i = 0 ; i < max-1 ; i++){
			nbPlayers[i] = i+2;
		}
		return nbPlayers;
	}
	
	public Integer[] getDimensions() {
		return (Integer[])this.keySet().toArray(new Integer[0]);
	}
}
